<form method="post" action="" enctype="multipart/form-data">
    <div class="col-xs-12 col-md-12 col-lg-12 padding-none lists">
        <div class="col-lg-2 col-md-3 col-xs-5 filed-name text-right">客服电话<pub>*</pub> :</div>
        <div class="col-lg-3 col-md-5 col-xs-7 filed-from padding-none">
            <input type="text" class="form-control radius-none _data" name="tel">
        </div>
    </div>

    <div class="col-xs-12 col-md-12 col-lg-12 padding-none lists">
        <div class="col-lg-2 col-md-3 col-xs-5 filed-name text-right">客服QQ<pub>*</pub> :</div>
        <div class="col-lg-3 col-md-5 col-xs-7 filed-from padding-none">
            <input type="text" class="form-control radius-none _data" name="qq">
        </div>
    </div>

    <div class="col-xs-12 col-md-12 col-lg-12 padding-none lists">
        <div class="col-lg-2 col-md-3 col-xs-5 filed-name text-right">微信号<pub>*</pub> :</div>
        <div class="col-lg-3 col-md-5 col-xs-7 filed-from padding-none">
            <input type="text" class="form-control radius-none _data" name="wechat">
        </div>
    </div>

    <div class="col-xs-12 col-md-12 col-lg-12 lists text-right">
        <input type="submit" class="btn radius-none submit" value="保存" name="submit">
        <input type="reset" class="btn btn-info radius-none" value="重置">
    </div>
</form>
<script>
    $(document).ready(function(){
        $('.submit').click(function(e){

            e.preventDefault();

            var tel = $('input[name=tel]').val();
            var qq = $('input[name=qq]').val();
            var wechat = $('input[name=wechat]').val();
            var url = '<?php echo U("/Admin/Basic/CustomService/create")?>';

            var isMob=/^1[3-5,8]{1}[0-9]{9}$/;
            var isTel=/^([0-9]{3,4}-)?[0-9]{7,8}$/;

            if(!tel){
                alert('请输入客服联系电话');
                return false;
            }

            if(!isMob.test(tel) && !isTel.test(tel)){
                alert('请输入正确的客服联系电话');
                return false;
            }

            if(!qq){
                alert('请输入客服qq');
                return false;
            }

            if(isNaN(qq)){
                alert('客服qq格式有误');
                return false;
            }

            if(!wechat){
                alert('请输入客服微信号');
                return false;            
            }

            $.post(url,{tel:tel,qq:qq,wechat:wechat},function(res){
                
                alert(res.msg);
                console.log(res);
            })

        })

    })

</script>